import ajax from './index'

// 会员列表
export function member_list(condition) {
  if (!condition) {
    condition = {
      pageNum: 1,
      pageSize: 100
    }
  }
  return ajax({
    url: "/backend/member/list",
    method: "get",
    params: condition
  });
}
// 会员详情

export function member_detail(id) {
  return ajax({
    url: "/backend/member/detail/" + id,
    method: "get"
  });
}
// 封禁会员/backend/member/check

export function member_check(param) {
  return ajax({
    url: "/backend/member/check",
    method: "post",
    data: param
  });
}
// 激活会员
export function member_check2(param) {
  return ajax({
    url: "/backend/member/check2",
    method: "post",
    data: param
  });
}
// 删除会员

export function member_delete(id) {
  return ajax({
    url: `/backend/member/delete/${id}`,
    method: "post"
  });
}
// 调整红包
export function member_update_redpacket(param) {
  return ajax({
    url: "/backend/member/updateRedpacket",
    method: "post",
    data: param
  });
}

export function member_update_fuli(param) {
  return ajax({
    url: "/backend/member/updateFuli",
    method: "post",
    data: param
  });
}
// 红包记录
export function redpacket_list(condition) {

  return ajax({
    url: "/backend/member/redpacketList",
    method: "get",
    params: condition
  });
}

export function fuli_list(condition) {
  if (!condition) {
    condition = {
      pageNum: 1,
      pageSize: 100
    }
  }
  return ajax({
    url: "/backend/member/fuliList",
    method: "get",
    params: condition
  });
}
// 资金流水

export function money_list(condition) {
  if (!condition) {
    condition = {
      pageNum: 1,
      pageSize: 100
    }
  }
  return ajax({
    url: "/backend/member/moneyList",
    method: "get",
    params: condition
  });
}
// 资金流水-新

export function commissionRecordList(condition) {

  return ajax({
    url: "/backend/member/commissionRecordList",
    method: "get",
    params: condition
  });
}
// 手动调整金额
export function member_update_money(param) {
  return ajax({
    url: "/backend/member/updateMoney",
    method: "post",
    data: param
  });
}
// 手动调整佣金
export function adjustCommissionsManually(param) {
  return ajax({
    url: "/backend/member/adjustCommissionsManually",
    method: "post",
    data: param
  });
}
// 更新上级关系
export function updateParentIds(param) {
  return ajax({
    url: "/backend/member/updateParentIds",
    method: "post",
    data: param
  });
}
// 分页列表
export function sale_rule_list(condition) {

  return ajax({
    url: "/backend/commissionRule/pageList",
    method: "POST",
    data: condition
  });
}

export function sale_rule_detail(id) {
  return ajax({
    url: "/backend/member/saleRuleDetail/" + id,
    method: "get"
  });
}
// 更新佣金规则
export function sale_rule_update(param) {
  return ajax({
    url: "/backend/commissionRule/update",
    method: "post",
    data: param
  });
}
// 新增佣金规则
export function sale_rule_save(param) {
  return ajax({
    url: "/backend/commissionRule/save",
    method: "post",
    data: param
  });
}
// 删除规则
export function sale_rule_delete(id) {
  return ajax({
    url: "/backend/commissionRule/delete/" + id,
    method: "post",
  });
}
export function sale_rule_all() {
  return ajax({
    url: "/backend/member/saleRuleAll",
    method: "get"
  });
}


export function importFuli(data) {
  return ajax({
    url: '/backend/member/importFuli',
    method: 'post',
    data: data
  })
}

// 提现记录
export function withdraw_list(condition) {
  if (!condition) {
    condition = {
      pageNum: 1,
      pageSize: 100
    }
  }
  return ajax({
    url: "/backend/member/withdrawList",
    method: "get",
    params: condition
  });
}
// 提现操作
export function withdrawOperate(data) {
  return ajax({
    url: '/backend/member/withdrawOperate',
    method: 'post',
    data: data
  })
}
// 会员编辑

export function memberEdit(param) {
  return ajax({
    url: "/backend/member/edit",
    method: "post",
    data: param
  });
}

// 新建佣金规则
// 更新佣金规则
// 删除佣金规则
// 分页列表

export function couponOrderList(uid) {

  return ajax({
    url: "/backend/shopVipRelation/couponOrderList?uid=" + uid,
    method: "POST"
  });
}
export function shopMallOrderlist(uid) {

  return ajax({
    url: "/backend/shopVipRelation/shopMallOrderlist?uid=" + uid,
    method: "POST"
  });
}
